package com.yx.changdao.common.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.yx.changdao.common.annotation.AutoFill;
import com.yx.changdao.common.utils.SysUtils;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.Date;
import java.math.BigDecimal;


@TableName(Department.TABLE_NAME)
@Getter
@Setter
public class Department implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 数据库名
     */
    public static final String TABLE_NAME = "department";

    /**
     * 主键id
     */
    public static final String DEP_ID = "dep_id";
    /**
     * 部门名称
     */
    public static final String DEP_NAME = "dep_name";
    /**
     * 创建时间
     */
    public static final String CREATE_TIME = "create_time";
    /**
     * 创建人
     */
    public static final String CREATE_BY_NAME = "create_by_name";
    /**
     * 创建人id
     */
    public static final String CREATE_BY = "create_by";
    /**
     * 更新时间
     */
    public static final String UPDATE_TIME = "update_time";
    /**
     * 更新人
     */
    public static final String UPDATE_BY_NAME = "update_by_name";
    /**
     * 更新人id
     */
    public static final String UPDATE_BY = "update_by";


    /**
     * 主键id
     */
    @TableId(type = IdType.AUTO)
    private Integer depId;
    /**
     * 部门名称
     */
    @NotEmpty(message = "部门名称不能为空")
    private String depName;
    /**
     * 创建时间
     */
    @AutoFill
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    /**
     * 创建人
     */
    @AutoFill(klass = SysUtils.class, method = "currentUserName")
    @TableField(fill = FieldFill.INSERT)
    private String createByName;
    /**
     * 创建人id
     */
    @AutoFill(klass = SysUtils.class, method = "currentUserId")
    @TableField(fill = FieldFill.INSERT)
    private String createBy;
    /**
     * 更新时间
     */
    @AutoFill
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
    /**
     * 更新人
     */
    @AutoFill(klass = SysUtils.class, method = "currentUserName")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updateByName;
    /**
     * 更新人id
     */
    @AutoFill(klass = SysUtils.class, method = "currentUserId")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updateBy;
}
